<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<table id="dataTable">
    <thead>
    <th>图片</th>
    <th>商家</th>
    <th>商品</th>
    <th>商品单价</th>
    <th>订单金额</th>
    </thead>
    <tbody>
    <tr th:each="bill:${bills}">
        <td><img style="width:700px;height:500px" th:src="@{'/photo/'+${bill.goods.avatar}}"></td>
        <td th:text="${bill.goods.marketersName}"></td>
        <td th:text="${bill.goods.goodsName}"></td>
        <td th:text="${bill.goods.goodsPrice}"></td>
        <td th:text="${bill.money}"></td>
        <td><a @click="updateBill" th:href="@{'agreeBill/'+${bill.billId}}">收货</a></td>
    </tr>
    </tbody>
</table>
<form id="updateForm" method="post">
    <input type="hidden" name="_method" value="PUT">
</form>
<script type="text/javascript" th:src="@{/static/js/vue.js}"></script>
<script type="text/javascript">
    var vue = new Vue({
        el:"#dataTable",
        methods:{
            updateBill:function (event) {
                var updateForm = document.getElementById("updateForm");
                updateForm.action = event.target.href;
                updateForm.submit();
                event.preventDefault();
            }
        }
    });
</script>

</body>
</html>